package com.sunxu.exercise3;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * ${DESCRIPTION}
 *
 * @author Sun
 * @create 2017-08-01-18:24
 */
public class Demo3 {
    public static void main(String[] args) {
        List<User> users = new ArrayList<>();
        users.add(new User(20, "张三"));
        users.add(new User(22, "李四"));
        users.add(new User(30, "王五"));

        Stream<User> stream = users.stream();
        long count = stream.filter((User user) -> user.getId() > 20).map((User user) -> {
            return "50";
        }).count();
        System.out.println(count);
    }
}
